package com.longcai.controller.fuyoupay;


import com.alibaba.fastjson.JSONObject;
import com.longcai.bean.ApiResult;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouAgencyPay;
import com.longcai.service.fuyoupay.ClyjFuyouAgencyPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 普通用户提现接口
 * /p>
 *
 * @author M
 * @since 2019-04-18
 */
@Controller
@RequestMapping("/clyjFuyouAgencyPay")
public class ClyjFuyouAgencyPayController {
    @Autowired
    private ClyjFuyouAgencyPayService clyjFuyouAgencyPayService;

    @RequestMapping("/agencyPaySave")
    @ResponseBody
    public ApiResult<?> recharge(@RequestBody JSONObject params) {
        ClyjFuyouAgencyPay cfap = clyjFuyouAgencyPayService.checkout(params);
        if (cfap != null) {
            boolean b = clyjFuyouAgencyPayService.insert(cfap);
            if (b) {
                return ApiResult.success("查询成功");
            }
        }
        return ApiResult.fail("查询失败");
    }
}

